{case value="editor"}
<!-- 加载编辑器的容器 -->
<textarea style="display: none;" name="{$_item['name']}">
    {$_data[$_item['name']]}
</textarea>
    <textarea id="{$_item['name']}{$_i}" style="height: 300px;" type="text/plain">
            {notempty name="_item.name"}
                {$_data[$_item['name']]}
            {/notempty}
    </textarea>
<!-- 配置文件 -->
<script>
    {peter:if exp="$_item['opt']['all_toolbars']"}
    Object.assign(window.UEDITOR_CONFIG,{
        toolbars: [[
            'fullscreen', 'source', '|', 'undo', 'redo', '|',
            'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
            'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
            'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
            'directionalityltr', 'directionalityrtl', 'indent', '|',
            'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
            'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
            'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map', 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', 'template', 'background', '|',
            'horizontal', 'date', 'time', 'spechars', 'snapscreen', 'wordimage', '|',
            'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
            'print', 'preview', 'searchreplace', 'help', 'drafts'
        ]]
    });
    {peter:else /}
    Object.assign(window.UEDITOR_CONFIG,{
        toolbars: [[
            'source','|','bold','italic','underline','fontsize','forecolor','justifyleft','fontfamily','|','map','emotion','insertimage','insertcode'
        ]]
    });
    {/peter:if}
</script>
<!-- 实例化编辑器 -->
<script type="text/javascript">
    (function(){
        var ue = UE.getEditor('{$_item['name']}{$_i}');
        ue.addListener('selectionchange',function () {
            var value = ue.getContent();
            $('[name={$_item["name"]}]').prop('value',value);
        });
    })();


</script>
{/case}